﻿@*@model PessMvc.Models.ArchivePaperReviewFeedbackModel*@
@model PessModel.Archive
@{
    ViewBag.Title = "ReviewPaperFeedback";
    
}

<h2 style="width:400px;">Review Paper Feedback</h2>
<div id="operate">
    @Html.ActionLink("Back to My Proposals", "Proposals")
</div>


<div style="margin-top:20px;">
    <fieldset class="show">
        <legend></legend>
        <div class="displayHead" style="padding-right:5px;">
            @Html.DisplayFor(model => model.CalculatedSerialNumber): @Html.DisplayFor(model => model.ProjectTitle)
        </div>
        <p></p>
        @*<p><strong>Final Paper Review result:</strong> @Model.PaperStatusName</p>*@
        @*@if(Model.PaperStatus!=5)
        { 
            <p><strong>Accepte as Format:</strong> @Model.County1.Name</p>
        }*@
        <p></p>

        <!--Editor's comments-->
        <div class="ReviewBox">
            <div class="ReviewHeader">
                Editor's Feedback
                @*@if (Model.PaperStatus == 6)
                {
                    <img src="@Url.Content("~/images/green20.png")" alt="Accepted" style="vertical-align:text-top;margin-left:30px;" title="Accepted" />;
                }
                else if (Model.PaperStatus == 7)
                {
                    <img src="@Url.Content("~/images/yellow20.png")" alt="Revise" style="vertical-align:text-top;margin-left:30px;" title="Revise" />;
                }
                else if (Model.PaperStatus == 5)
                {
                    <img src="@Url.Content("~/images/red20.png")" alt="Rejected" style="vertical-align:text-top;margin-left:30px;" title="Rejected" />;
                }*@
            </div>
            <div class="ReviewBody" style="">
                @*<div class="display-label">
                    Comments
                </div>
                <div class="display-field">*@
                    @MvcHtmlString.Create(@Model.EditorPaperReviewFeedback)
                @*</div>
                <div class="display-label">
                    Paper Status:
                </div>
                <div class="display-field">
                    @Model.PaperStatusName
                </div>*@
            </div>
        </div>

        @if(Model.PaperStatus>=5)
        { 
        @*if (Model.PaperComments.Count > 0)//list all reviewers' results
        {
                int x = 1;
                foreach (var rf in Model.PaperComments)
                {
                    <div class="ReviewBox">
                        <div class="ReviewHeader" >
                            Review #@x
                            @if (rf.PaperStatus == 1)
                            {
                                <img src="@Url.Content("~/images/green20.png")" alt="Accepted" style="vertical-align:text-top;margin-left:30px;" title="Accepted" />;
                            }
                            else if (rf.PaperStatus == 2)
                            {
                                <img src="@Url.Content("~/images/yellow20.png")" alt="Rejected" style="vertical-align:text-top;margin-left:30px;" title="Revise" />;
                            }
                            else if (rf.PaperStatus == 0)
                            {
                                <img src="@Url.Content("~/images/red20.png")" alt="Rejected" style="vertical-align:text-top;margin-left:30px;" title="Rejected" />;
                            }
                        </div>
                        <div class="ReviewBody" style="">
                            @foreach (var s in Model.PaperScores.Where(s => s.ExpertJudgeSerialNumber == rf.ExpertSerialNumber))
                            {
                                <div class="display-label-rules">
                                    @s.PaperRule.Name
                                </div>
                                <div class="display-field-rules">
                                    @s.Value
                                </div>
                            }

                            <div class="display-label-rules">
                                Comments
                            </div>
                            <div class="display-field-rules">
                                @MvcHtmlString.Create(@rf.Comment)
                            </div>
                            <div class="display-label-rules">
                                Status
                            </div>
                            <div class="display-field-rules">
                                @((PessModel.PaperAcceptanceStatus)rf.PaperStatus)
                            </div>
                        </div>
                    </div>
                            x++;
                }
            }
            else
            {
                <h3>There is no review record available for this proposal!</h3>
            }*@
        }
      



        @*
                <!--Reviewers' comments-->
                <div class="displayHead" style="padding-right:5px;">
                    @Html.DisplayFor(model => model.ProposalID): @Html.DisplayFor(model => model.ProposalTitle)
                </div>
                <p></p>
                <h3>Final Review result: @Model.Status</h3>
            <p></p>

                @if(Model.Feedbacks.Count>0)
                {
                    int x=1;
                    foreach (var rf in Model.Feedbacks)
                    {
                        <div class="ReviewBox">
                            <div class="ReviewHeader">Review #@x
                                @if ((int)rf.Acceptance ==1)
                                {
                                    <img src="@Url.Content("~/images/green20.png")" alt="Accepted" style="vertical-align:text-top;margin-left:30px;" title="Accepted" />;
                                }
                                else
                                {
                                    <img src="@Url.Content("~/images/red20.png")" alt="Rejected" style="vertical-align:text-top;margin-left:30px;" title="Rejected" />;
                                }
                            </div>
                            <div class="ReviewBody" style="">
                                @foreach (var s in rf.Scores)
                                {
                                    <div class="display-label">
                                         @s.Key
                                    </div>
                                    <div class="display-field">
                                        @s.Value
                                    </div>
                                }
                                <div class="display-label" >
                                    Comment
                                </div>
                                <div class="display-field">
                                    @rf.Comment
                                </div>
                                <div class="display-label" >
                                    Status
                                </div>
                                <div class="display-field">
                                    @rf.Acceptance
                                </div>
                            </div>
                        </div>
                        x++;
                    }
                }
                else
                {
                    <h3>There is no review record available for this proposal!</h3>
                }*@
    </fieldset>

    </div>
